﻿using System; 
using System.Data;
using System.Collections.Generic; 
using JOIN.Rights.Model;
using Kevin.Framework.Data;

/*------------------------------------------------------------------------
   苏州捷安信息科技有限公司 版权所有			
   文件名: TU_UserArea.cs
   作 者 : 席吉波
   日 期 : 2012-10-19
   备 注 : 当您对本文件更改时请写明修改人、修改日期以及事由
  ------------------------------------------------------------------------
*/

namespace JOIN.Rights.BLL
{
	 	//TU_UserArea
		/// <summary>
	/// UserArea 业务操作类
	/// </summary>
	public partial class UserAreaBLL:BLLBase<UserAreaInfo>,ISelect<UserAreaInfo>
	{
		#region   构造函数
		
		/// <summary>
		/// UserAreaBLL  构造函数  
		/// </summary>
		public UserAreaBLL(UserAreaInfo entity)
			:base(entity)
		{
		
		}
		/// <summary>
		/// UserAreaBLL  构造函数  
		/// </summary>
		/// <param name="operationMode">操作模式</param>
        /// <param name="jsonEntity">前台javascript传过来的JSON实体</param>
		public UserAreaBLL(string operationMode, string jsonEntity)
        {
            OperState cmd = (OperState)Enum.Parse(typeof(OperState), operationMode);
            UserAreaInfo entity = ConvertJSON2Entity(jsonEntity);
            base.OperState = cmd;
            base.Entity = entity;
            base.ServiceResult = new ServiceResult<UserAreaInfo>();
            base.ServiceResult.Successed = true;
            base.ServiceResult.Object = base.Entity;
        }
        
        #endregion
        
        #region 查询方法
        
        /// <summary>
        /// 获取 UserAreaInfo 集合
        /// </summary>
        /// <param name="pageSize">分页记录数</param>
        /// <param name="pageIndex">页码索引</param>
        /// <returns></returns>
        public ServiceResult<UserAreaInfo> SelectByProperties(int pageSize, int pageIndex)
        {
            this.ServiceResult = new ServiceResult<UserAreaInfo>();
            try
            {
                int recordCount =0;
                List<UserAreaInfo> list = base.Entity.SelectedByProperties<UserAreaInfo>(out recordCount,pageSize,pageIndex);
                
                ServiceResult.Successed = true;
                ServiceResult.RecordCount = recordCount;
                ServiceResult.List = list;
                
            }
            catch(Exception ex){
                ServiceResult.ErrorMsg = "数据查询失败:"+ex.Message;
                ServiceResult.Successed = false;
                ServiceResult.RecordCount = 0;
                ServiceResult.List = null;
            }

            return ServiceResult;
        }
        
        #endregion
        
        #region 重写基类方法
        
        
        
        #endregion
   
	}
}